<template>
  <div>
    <div>
        <h2>我的订单</h2>
    </div>
    <div  v-for="i,j in orderlist" :key="j">

    订单号：{{i.order_id}} <br>
    商品：{{i.goods.name}} <br>
    购买人：{{i.users.name}} <br>
    会员id：{{i.users.id}} &emsp;&emsp;
    手机号：{{i.users.phone}} <br>
    总价：{{i.price}} <br>
    <hr color="pink" size="4">
    </div>
  </div>
</template>

<script>
export default {
    data(){
        return{

            uid:localStorage.getItem('ks_uid')||'',
            orderlist:[],
      
        }
    },
    methods:{
        order(){
        this.myaxios(this.baseURL + 'order/','get',{uid:this.uid}).then(resp=>{
        console.log('获取订单',resp)
        if(resp.errcode==0){
          this.$toast.success(resp.msg)
          this.orderlist = resp.data
          
        }else{
            this.$toast.fail(resp.msg)
        }
      })
        }
    },
    mounted(){
        this.order()
    }

}
</script>

<style>


</style>